home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpC_1014_List < prev    next >
Encoding:
Text File  |  1992-04-08  |  2.8 KB  |  110 lines

  1. %case window field%
  2.     ListHandle        %HandleName%;
  3.     short            %fieldname%;
  4. %case winAuxiliaryProto%
  5.     static void Build%itemname%    (void);
  6. %case winAuxiliary%
  7.     /*----------*/
  8.     static void Build%itemname%    ()
  9.     {
  10.         Rect            bounds;
  11.  
  12.         SetWFont (%itemname%);
  13.         GetWRect (%itemname%, &bounds);
  14.         cur->%HandleName% = NewV1List (bounds, qd.thePort);
  15.         AddToList ("\pOne",   cur->%HandleName%);
  16.         AddToList ("\pTwo",   cur->%HandleName%);
  17.         AddToList ("\pThree", cur->%HandleName%);
  18.         AddToList ("\pInfinity",  cur->%HandleName%);
  19.         LDoDraw (true, cur->%HandleName%);
  20.  
  21.     } /*Build%Itemname%*/
  22.  
  23. %case create%
  24.     Build%itemname% ();
  25. %case dispose%
  26.     LDispose (cur->%HandleName%);
  27. %case mousein%
  28.     if (PtInRect (where, &(**(cur->%HandleName%)).rView)) {
  29.         if (LClick (where, modifiers, cur->%HandleName%)) {
  30.             /*double click*/
  31.         }
  32.         if (GetListChoice (&cur->%fieldname%, cur->%HandleName%)) {
  33.             /* something is selected */
  34.         }
  35.     }
  36. %case update%
  37.     SetWFont (%itemname%);
  38.     LUpdate (qd.thePort->visRgn, cur->%HandleName%);
  39.     bounds = (**(cur->%HandleName%)).rView;
  40.     InsetRect (&bounds, -1, -1);
  41.     FrameRect (&bounds);
  42. %case activate%
  43.     LActivate (activate, cur->%HandleName%);
  44. %case track%
  45.     if ((whichControl == (**(cur->%HandleName%)).vScroll)
  46.     ||  (whichControl == (**(cur->%HandleName%)).hScroll)) {
  47.         if (LClick (where, 0, cur->%HandleName%)) {
  48.             /*double click in scroll bar*/
  49.         }
  50.     }
  51. %case itemNr%
  52.     %DefineItem%
  53. %case dialog field%
  54.     short            %fieldname%;
  55.     %haveField%
  56. %case init field%
  57.     info->%fieldname% = -1;
  58. %case auxiliaryProto%
  59.     static          void Build%itemname% (void);
  60.     static pascal void Draw%itemname%%    %(DialogPtr        whichDialog,
  61.                                          short            itemNr);
  62. %case auxiliary%
  63.     %needsFilter%
  64.     /*----------*/
  65.     static ListHandle        %itemname%Handle;
  66.  
  67.     /*----------*/
  68.     static void Build%itemname% ()
  69.     {
  70.         %itemname%Handle = Vert1List (%itemname%);
  71.         AddToList ("\pOne",   %itemname%Handle);
  72.         AddToList ("\pTwo",   %itemname%Handle);
  73.         AddToList ("\pThree", %itemname%Handle);
  74.         AddToList ("\pInfinity",  %itemname%Handle);
  75.         LDoDraw (true, %itemname%Handle);
  76.  
  77.     } /*Build%Itemname%*/
  78.  
  79.     /*----------*/
  80.     static pascal void Draw%itemname%%    %(DialogPtr        whichDialog,
  81.                                          short            itemNr)
  82.     {
  83.     %if lang = MPW%
  84.         #pragma unused (whichDialog, itemNr)
  85.     
  86.     %endif%
  87.         DrawList (%itemname%Handle);
  88.     } /*Draw%itemname%*/
  89.     
  90. %case filter%
  91.     if (!filtered) {
  92.         filtered = FilterList (event, %itemname%Handle, %itemname%, %itemname%, itemHit);
  93.     }
  94. %case set%
  95.     Build%itemname% ();
  96.     %if lang = AUX%
  97.         SetUserItem (%itemname%, (ProcPtr) Draw%itemname%);
  98.     %else%
  99.         SetUserItem (%itemname%, (ProcPtr) &Draw%itemname%);
  100.     %endif%
  101.     SetListChoice (info->%fieldname%, %itemname%Handle);
  102. %case hit%
  103.     case %itemname%:
  104.             if (GetListChoice (&info->%fieldname%, %itemname%Handle)) {
  105.                 /* something is selected */
  106.             }
  107.         break;
  108. %case finish%
  109.     LDispose (%itemname%Handle);
  110.